home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / recent / iib122.lha / IIB / ARexx / SiteSearch.rx < prev    next >
Text File  |  1998-05-03  |  2KB  |  127 lines

  1. /* SiteSearch.rx, V1.1, ©1998 Salvatore Cagliari */
  2.  
  3. /* Set Start-Parameters */
  4. Parse Arg Line
  5.  
  6. scriptname = "Site Search"
  7.  
  8. Options Results
  9.  
  10. /*
  11.  *  If not called from Fiasco, try to address the active
  12.  *  Fiasco project
  13.  */
  14. if ~abbrev(address(), "FIASCO.") then
  15. do
  16.     ports = show("Ports")
  17.  
  18.     do i = 1 to words(ports)
  19.  
  20.         if abbrev(word(ports, i), "FIASCO.") then
  21.         do
  22.             Address Value word(ports, i)
  23.  
  24.             GetAttr Project Name Active ARexx
  25.  
  26.             Address Value Result
  27.  
  28.             break
  29.         end
  30.     end
  31. end
  32.  
  33. Thread_Port = address()
  34.  
  35. Signal on Syntax
  36. Signal on Halt
  37. Signal on Break_C
  38. Signal on Failure
  39.  
  40. /* Get the FieldID of the requested Line */
  41. Field = 'eMail.'|| Line
  42.  
  43. GetField Field
  44.  
  45. if rc~=0 then call script_out
  46.  
  47. eMail = result
  48.  
  49. /* Open the WebSites database in a new window */
  50.  
  51. open 'IIB:WebSites.fdb' New
  52. if rc~=0 then call script_out
  53.  
  54. Address Value Result
  55.  
  56. WebSites_Port = Result
  57.  
  58. /* Set the Searchinformations and search for the requested Record */
  59.  
  60. NewSearchInfo Name "eMail_Adr"
  61.  
  62. if result ~= "eMail_Adr" then
  63. do
  64.     signal Failure
  65. end
  66.  
  67. SetSearchField SearchInfo "eMail_Adr" FieldID "eMail" Pattern eMail
  68.  
  69. if rc ~= 0 then signal Failure
  70.  
  71. Find SearchInfo "eMail_Adr" Record 0
  72.  
  73. if rc~=0 then signal Failure
  74.  
  75. record = result
  76.  
  77. /* Activate the requested Record */
  78.  
  79. ActiveRecord "Record" record
  80.  
  81. if result ~= record then signal Failure
  82.  
  83. script_out:
  84.  
  85. Address Thread_Port
  86.  
  87. exit
  88.  
  89. syntax:
  90. failure:
  91.  
  92. if show("Ports", Thread_Port) then
  93. do
  94.     Interpret Address Thread_Port
  95.  
  96.     RequestChoice '"Error ' || rc || ' in line ' || sigl || ':*n' || errortext(rc) || '" "Cancel" Title "' || scriptname || '"'
  97. end
  98. else
  99. do
  100.     say "Error" rc "in line" sigl ":" errortext(rc)
  101.     say "Enter to continue"
  102.     pull dummy
  103. end
  104.  
  105. call script_out
  106.  
  107. halt:
  108. break_c:
  109.  
  110. if show("Ports", Thread_Port) then
  111. do
  112.     Interpret Address Thread_Port
  113.  
  114.     RequestChoice '"Script Abort Requested" "Abort Script" Title "' || scriptname || '"'
  115.  
  116.     if result = 0 then return
  117. end
  118. else
  119. do
  120.     say "*** Break"
  121.     say "Enter to continue"
  122.     pull dummy
  123. end
  124.  
  125. call script_out
  126.  
  127.